-
Notifications
You must be signed in to change notification settings - Fork 744
/
DataService.cs
63 lines (55 loc) · 2.17 KB
/
DataService.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information
namespace DotNetNuke.Entities.Portals.Data
{
using System.Data;
using DotNetNuke.ComponentModel;
using DotNetNuke.Data;
public class DataService : ComponentBase<IDataService, DataService>, IDataService
{
private readonly DataProvider provider = DataProvider.Instance();
/// <inheritdoc/>
public int AddPortalGroup(PortalGroupInfo portalGroup, int createdByUserId)
{
return this.provider.ExecuteScalar<int>(
"AddPortalGroup",
portalGroup.PortalGroupName,
portalGroup.PortalGroupDescription,
portalGroup.MasterPortalId,
portalGroup.AuthenticationDomain,
createdByUserId);
}
/// <inheritdoc/>
public void DeletePortalGroup(PortalGroupInfo portalGroup)
{
this.provider.ExecuteNonQuery("DeletePortalGroup", portalGroup.PortalGroupId);
}
/// <inheritdoc/>
public IDataReader GetPortalGroups()
{
return this.provider.ExecuteReader("GetPortalGroups");
}
/// <inheritdoc/>
public void UpdatePortalGroup(PortalGroupInfo portalGroup, int lastModifiedByUserId)
{
this.provider.ExecuteNonQuery(
"UpdatePortalGroup",
portalGroup.PortalGroupId,
portalGroup.PortalGroupName,
portalGroup.PortalGroupDescription,
portalGroup.AuthenticationDomain,
lastModifiedByUserId);
}
/// <inheritdoc/>
public IDataReader GetSharedModulesWithPortal(PortalInfo portal)
{
return this.provider.ExecuteReader("GetSharedModulesWithPortal", portal.PortalID);
}
/// <inheritdoc/>
public IDataReader GetSharedModulesByPortal(PortalInfo portal)
{
return this.provider.ExecuteReader("GetSharedModulesByPortal", portal.PortalID);
}
}
}